import {NgModule} from '@angular/core';
import {RouterModule, Routes} from "@angular/router";
import {NewsComponent} from "@news/news.component";
import {PhotoNewsComponent} from "@news/photo-news/photo-news.component";
import {RecommendComponent} from "@news/recommend/recommend.component";
import {NewsCommentComponent} from "@news/comment/news-comment.component";

const routes: Routes = [
  {
    path: '',
    children: [
      {
        path: ':articleId',
        component: NewsComponent,
      },
      {
        path: 'photo-news/:cateId/:articleId',
        component: PhotoNewsComponent
      },
      {
        path: 'recommend/:cateId/:articleId',
        component: RecommendComponent
      },
      {
        path: 'comment/:articleId',
        component: NewsCommentComponent
      }
    ]
  }
];

@NgModule({
  imports: [
    RouterModule.forChild(routes)
  ],
  exports: [RouterModule]
})
export class NewsRoutingModule {
}
